import React, { Component } from 'react'
import { Table } from 'antd'
import { start, doing, end } from './mock'
const object = {
  start,
  doing,
  end,
}
const ajax = () => {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve(Math.random() > 0.3)
    }, 1000)
  })
}

export default class componentName extends Component {
  columns = () => {
    return [
      {
        title: '姓名',
        dataIndex: 'name',
        key: 'name',
      },
      {
        title: '年龄',
        dataIndex: 'age',
        key: 'age',
      },
      {
        title: '住址',
        dataIndex: 'address',
        key: 'address',
      },
      {
        title: '操作',
        render: (v, r, i) => {
          return <a onClick={() => {}}>删除</a>
        },
      },
    ]
  }
  render() {
    return (
      <Table
        dataSource={object[this.props.value || 'start']}
        columns={this.columns()}
      />
    )
  }
}
